package ex5;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex5_4 extends JFrame {
	ex5_4(){
        this.setBounds(10, 10, 500, 500);
        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton btn=new JButton("隐藏");
        btn.setBounds(10, 20, 100, 60);
        Container c=this.getContentPane();
        JLabel label=new JLabel();
        label.setBounds(10, 50, 200, 300);
        label.setText("这是一个隐藏的文本");
        c.add(btn);
        c.setLayout(null);
        c.add(label);
        btn.addActionListener(new ActionListener() {
        	@Override
        	public void actionPerformed(ActionEvent e) {
        		label.setVisible(false);
        	}
        });
        
       
        
	}
	 

	public static void main(String[] args) {
		new ex5_4();

	}

}
